import { GetterTree } from "vuex";
import { State } from "./state";

import { RootState } from "../index";

// 声明getters
export type Getters = {
  getAuthor(state: State): string;
};

// 实例化这个 getters 需要聚合getter
// GetterTree<S, R> S:模块局部状态  R:根状态
export const getters: GetterTree<State, RootState> & Getters = {
  getAuthor(state) {
    return state.name;
  },
};
